function [b,status]=strbody1(file1)
global pol_cof
global pol_der
global tot_len
global blevel
global cur_x
global cur_y
[a(:,1),a(:,2),a(:,3),a(:,4),a(:,5),a(:,6),a(:,7)]=textread(file1,'%f %f %f %f %f %f %f',-1,'commentstyle','shell');
%com_text(:)=textread(file1,'%c');

%file2=[file1(1:end-4) 's.cws'];

indv=find(a(:,2) == 14);
lc=a(indv,:);%
if ~isempty(lc)
%approximation by polynomial degree 10
pdeg=10;
pol_cof = polyfit(lc(:,3),lc(:,4),pdeg);
mul1=pdeg:-1:1;
pol_der=pol_cof(1:end-1).*mul1;

qq1=linspace(lc(1,3),lc(end,3),100);
yy = polyval(pol_cof, qq1);
%plot(qq1,yy,'g');


%calculation of rectangle coordinates of the current point
for i=1:size(a,1)
  cur_x=a(i,3);
  cur_y=a(i,4);
  x_curv = fzero(@curve_point,cur_x);
  y_curv=polyval(pol_cof,x_curv);
   b(i,1:7)=a(i,1:7);
   b(i,3)=quad(@myfun,0,cur_x);
   b(i,4)=sqrt((cur_x-x_curv)^2+(cur_y-y_curv)^2);
 
end;
status=0;
else
    %display('BODY STRAIGHTENING: There are no ventral edge. Matrix was not changed')
    status=1;
    b=a;
end;
    


% figure(2);
% hold on;
% plot3(x_rec,y_rec,axon(:,5));
% plot3(x_rec1,y_rec1,axon1(:,5),'k');
% plot3(x_rec2,y_rec2,axon2(:,5),'m');
